home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / fgl110c.zip / 12-09.C < prev    next >
Text File  |  1992-01-31  |  1KB  |  53 lines

  1. #include <fastgraf.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. void main(void);
  6.  
  7. int solid[]  = {0xE03F,0xE03F,0xE03F,0x0007,0x0007,0x0007,0x0007,0x0007,
  8.                 0x0007,0x0007,0xE03F,0xE03F,0xE03F,0xFFFF,0xFFFF,0xFFFF,
  9.                 0x0000,0x0F80,0x0F80,0x0F80,0x7FF0,0x7FF0,0x7FF0,0x7FF0,
  10.                 0x7FF0,0x0F80,0x0F80,0x0F80,0x0000,0x0000,0x0000,0x0000};
  11.  
  12. int hollow[] = {0xE03F,0xEFBF,0xEFBF,0x0F87,0x7FF7,0x7FF7,0x7FF7,0x7FF7,
  13.                 0x7FF7,0x0F87,0xEFBF,0xEFBF,0xE03F,0xFFFF,0xFFFF,0xFFFF,
  14.                 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0200,0x0000,
  15.                 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000};
  16.  
  17. void main()
  18. {
  19.    int old_mode;
  20.    int column, row, last_row;
  21.  
  22.    old_mode = fg_getmode();
  23.    fg_setmode(fg_automode());
  24.  
  25.    if (fg_mouseini() < 0) {
  26.       fg_setmode(old_mode);
  27.       fg_reset();
  28.       exit(1);
  29.       }
  30.  
  31.    fg_setcolor(15);
  32.    fg_rect(0,fg_getmaxx(),0,fg_getmaxy());
  33.  
  34.    fg_setcolor(12);
  35.    column = fg_xalpha(fg_getmaxx()/2) - 6;
  36.    last_row = fg_yalpha(fg_getmaxy()) + 1;
  37.  
  38.    for (row = 0; row < last_row; row++) {
  39.       fg_locate(row,column);
  40.       fg_text("example 12-9",12);
  41.       }
  42.  
  43.    fg_mousevis(1);
  44.    fg_waitkey();
  45.    fg_mouseptr(solid,6,6);
  46.    fg_waitkey();
  47.    fg_mouseptr(hollow,6,6);
  48.    fg_waitkey();
  49.  
  50.    fg_setmode(old_mode);
  51.    fg_reset();
  52. }
  53.